package demo6;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Person {
    @Resource(name = "shirt")
    private Clothes clothes;

//    @Resource
//    private Clothes shirt;//还可以根据属性名装配，与类名一致(除了首字母小写)

    @Override
    public String toString() {
        return "Person{" +
                "clothes=" + clothes +
                '}';
    }
}
